package cn.genmer.test.security.thread.threadcoreknowledge.createthreads.wrongways;

import java.util.Timer;
import java.util.TimerTask;

/**
 * @program: concurrency_practice
 * @description: 定时器创建线程
 * @author: Genmer
 * @create: 2020-10-12 15:16
 **/
public class DemoTimeTask {
    public static void main(String[] args) {
        Timer timer = new Timer();
        timer.scheduleAtFixedRate(new TimerTask() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName());
            }
        },1000, 1000);
    }
}
